<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Unsafe #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE ExistentialQuantification, NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE MagicHash #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE UnboxedTuples #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Event.Internal</span><span>
</span><span id="line-7"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-8"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Event back end</span></span><span>
</span><span id="line-9"></span><span>      </span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier">Backend</span></a></span><span>
</span><span id="line-10"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#backend"><span class="hs-identifier">backend</span></a></span><span>
</span><span id="line-11"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#delete"><span class="hs-identifier">delete</span></a></span><span>
</span><span id="line-12"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#poll"><span class="hs-identifier">poll</span></a></span><span>
</span><span id="line-13"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#modifyFd"><span class="hs-identifier">modifyFd</span></a></span><span>
</span><span id="line-14"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#modifyFdOnce"><span class="hs-identifier">modifyFdOnce</span></a></span><span>
</span><span id="line-15"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html"><span class="hs-identifier">GHC.Event.Internal.Types</span></a></span><span>
</span><span id="line-16"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Helpers</span></span><span>
</span><span id="line-17"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#throwErrnoIfMinus1NoRetry"><span class="hs-identifier">throwErrnoIfMinus1NoRetry</span></a></span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span>    </span><span class="hs-comment">-- Atomic ptr exchange for WinIO</span><span>
</span><span id="line-20"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#exchangePtr"><span class="hs-identifier">exchangePtr</span></a></span><span>
</span><span id="line-21"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Foreign.C.Error.html"><span class="hs-identifier">Foreign.C.Error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Foreign.C.Error.html#eINTR"><span class="hs-identifier">eINTR</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Foreign.C.Error.html#getErrno"><span class="hs-identifier">getErrno</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Foreign.C.Error.html#throwErrno"><span class="hs-identifier">throwErrno</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Posix.Types.html"><span class="hs-identifier">System.Posix.Types</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier">Fd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Num.html"><span class="hs-identifier">GHC.Num</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Num.html#Num"><span class="hs-identifier">Num</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html"><span class="hs-identifier">GHC.Event.Internal.Types</span></a></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Ptr.html"><span class="hs-identifier">GHC.Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier">Ptr</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-comment">-- | Event notification backend.</span><span>
</span><span id="line-32"></span><span class="hs-keyword">data</span><span> </span><span id="Backend"><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-var">Backend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679552408"><span class="annot"><a href="#local-6989586621679552408"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span id="Backend"><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-var">Backend</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-33"></span><span>      </span><span id="_beState"><span class="annot"><span class="annottext">()
</span><a href="GHC.Event.Internal.html#_beState"><span class="hs-identifier hs-var hs-var">_beState</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621679552408"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-comment">-- | Poll backend for new events.  The provided callback is called</span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-comment">-- once per file descriptor with new events.</span><span>
</span><span id="line-37"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_bePoll"><span class="annot"><span class="annottext">()
</span><a href="GHC.Event.Internal.html#_bePoll"><span class="hs-identifier hs-var hs-var">_bePoll</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679552408"><span class="hs-identifier hs-type">a</span></a></span><span>                          </span><span class="hs-comment">-- backend state</span><span>
</span><span id="line-38"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Timeout"><span class="hs-identifier hs-type">Timeout</span></a></span><span>              </span><span class="hs-comment">-- timeout in milliseconds ('Nothing' for non-blocking poll)</span><span>
</span><span id="line-39"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>     </span><span class="hs-comment">-- I/O callback</span><span>
</span><span id="line-40"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-comment">-- | Register, modify, or unregister interest in the given events</span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-comment">-- on the given file descriptor.</span><span>
</span><span id="line-44"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_beModifyFd"><span class="annot"><span class="annottext">()
</span><a href="GHC.Event.Internal.html#_beModifyFd"><span class="hs-identifier hs-var hs-var">_beModifyFd</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679552408"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-45"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span>       </span><span class="hs-comment">-- file descriptor</span><span>
</span><span id="line-46"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span>    </span><span class="hs-comment">-- old events to watch for ('mempty' for new)</span><span>
</span><span id="line-47"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span>    </span><span class="hs-comment">-- new events to watch for ('mempty' to delete)</span><span>
</span><span id="line-48"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-comment">-- | Register interest in new events on a given file descriptor, set</span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-comment">-- to be deactivated after the first event.</span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_beModifyFdOnce"><span class="annot"><span class="annottext">()
</span><a href="GHC.Event.Internal.html#_beModifyFdOnce"><span class="hs-identifier hs-var hs-var">_beModifyFdOnce</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679552408"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-53"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span>    </span><span class="hs-comment">-- file descriptor</span><span>
</span><span id="line-54"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-comment">-- new events to watch</span><span>
</span><span id="line-55"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_beDelete"><span class="annot"><span class="annottext">()
</span><a href="GHC.Event.Internal.html#_beDelete"><span class="hs-identifier hs-var hs-var">_beDelete</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679552408"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span id="local-6989586621679552414"><span class="annot"><a href="GHC.Event.Internal.html#backend"><span class="hs-identifier hs-type">backend</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679552414"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Timeout"><span class="hs-identifier hs-type">Timeout</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679552414"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-62"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679552414"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679552414"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679552414"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-65"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span></span><span>
</span><span id="line-66"></span><span id="backend"><span class="annot"><span class="annottext">backend :: forall a.
(a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int)
-&gt; (a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool)
-&gt; (a -&gt; Fd -&gt; Event -&gt; IO Bool)
-&gt; (a -&gt; IO ())
-&gt; a
-&gt; Backend
</span><a href="GHC.Event.Internal.html#backend"><span class="hs-identifier hs-var hs-var">backend</span></a></span></span><span> </span><span id="local-6989586621679552372"><span class="annot"><span class="annottext">a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int
</span><a href="#local-6989586621679552372"><span class="hs-identifier hs-var">bPoll</span></a></span></span><span> </span><span id="local-6989586621679552371"><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool
</span><a href="#local-6989586621679552371"><span class="hs-identifier hs-var">bModifyFd</span></a></span></span><span> </span><span id="local-6989586621679552370"><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; IO Bool
</span><a href="#local-6989586621679552370"><span class="hs-identifier hs-var">bModifyFdOnce</span></a></span></span><span> </span><span id="local-6989586621679552369"><span class="annot"><span class="annottext">a -&gt; IO ()
</span><a href="#local-6989586621679552369"><span class="hs-identifier hs-var">bDelete</span></a></span></span><span> </span><span id="local-6989586621679552368"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552368"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-67"></span><span>  </span><span class="annot"><span class="annottext">a
-&gt; (a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int)
-&gt; (a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool)
-&gt; (a -&gt; Fd -&gt; Event -&gt; IO Bool)
-&gt; (a -&gt; IO ())
-&gt; Backend
forall a.
a
-&gt; (a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int)
-&gt; (a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool)
-&gt; (a -&gt; Fd -&gt; Event -&gt; IO Bool)
-&gt; (a -&gt; IO ())
-&gt; Backend
</span><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-var">Backend</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552368"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int
</span><a href="#local-6989586621679552372"><span class="hs-identifier hs-var">bPoll</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool
</span><a href="#local-6989586621679552371"><span class="hs-identifier hs-var">bModifyFd</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; IO Bool
</span><a href="#local-6989586621679552370"><span class="hs-identifier hs-var">bModifyFdOnce</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; IO ()
</span><a href="#local-6989586621679552369"><span class="hs-identifier hs-var">bDelete</span></a></span><span>
</span><span id="line-68"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#backend"><span class="hs-pragma hs-type">backend</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="annot"><a href="GHC.Event.Internal.html#poll"><span class="hs-identifier hs-type">poll</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Timeout"><span class="hs-identifier hs-type">Timeout</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-71"></span><span id="poll"><span class="annot"><span class="annottext">poll :: Backend -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int
</span><a href="GHC.Event.Internal.html#poll"><span class="hs-identifier hs-var hs-var">poll</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span><span> </span><span id="local-6989586621679552367"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552367"><span class="hs-identifier hs-var">bState</span></a></span></span><span> </span><span id="local-6989586621679552366"><span class="annot"><span class="annottext">a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int
</span><a href="#local-6989586621679552366"><span class="hs-identifier hs-var">bPoll</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; IO Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; IO ()
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int
</span><a href="#local-6989586621679552366"><span class="hs-identifier hs-var">bPoll</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552367"><span class="hs-identifier hs-var">bState</span></a></span><span>
</span><span id="line-72"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#poll"><span class="hs-pragma hs-type">poll</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-comment">-- | Returns 'True' if the modification succeeded.</span><span>
</span><span id="line-75"></span><span class="hs-comment">-- Returns 'False' if this backend does not support</span><span>
</span><span id="line-76"></span><span class="hs-comment">-- event notifications on this type of file.</span><span>
</span><span id="line-77"></span><span class="annot"><a href="GHC.Event.Internal.html#modifyFd"><span class="hs-identifier hs-type">modifyFd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-78"></span><span id="modifyFd"><span class="annot"><span class="annottext">modifyFd :: Backend -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool
</span><a href="GHC.Event.Internal.html#modifyFd"><span class="hs-identifier hs-var hs-var">modifyFd</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span><span> </span><span id="local-6989586621679552365"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552365"><span class="hs-identifier hs-var">bState</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679552364"><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool
</span><a href="#local-6989586621679552364"><span class="hs-identifier hs-var">bModifyFd</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; IO Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; IO ()
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool
</span><a href="#local-6989586621679552364"><span class="hs-identifier hs-var">bModifyFd</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552365"><span class="hs-identifier hs-var">bState</span></a></span><span>
</span><span id="line-79"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#modifyFd"><span class="hs-pragma hs-type">modifyFd</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-comment">-- | Returns 'True' if the modification succeeded.</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- Returns 'False' if this backend does not support</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- event notifications on this type of file.</span><span>
</span><span id="line-84"></span><span class="annot"><a href="GHC.Event.Internal.html#modifyFdOnce"><span class="hs-identifier hs-type">modifyFdOnce</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Posix.Types.html#Fd"><span class="hs-identifier hs-type">Fd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.Internal.Types.html#Event"><span class="hs-identifier hs-type">Event</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-85"></span><span id="modifyFdOnce"><span class="annot"><span class="annottext">modifyFdOnce :: Backend -&gt; Fd -&gt; Event -&gt; IO Bool
</span><a href="GHC.Event.Internal.html#modifyFdOnce"><span class="hs-identifier hs-var hs-var">modifyFdOnce</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span><span> </span><span id="local-6989586621679552363"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552363"><span class="hs-identifier hs-var">bState</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679552362"><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; IO Bool
</span><a href="#local-6989586621679552362"><span class="hs-identifier hs-var">bModifyFdOnce</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; IO ()
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; IO Bool
</span><a href="#local-6989586621679552362"><span class="hs-identifier hs-var">bModifyFdOnce</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552363"><span class="hs-identifier hs-var">bState</span></a></span><span>
</span><span id="line-86"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#modifyFdOnce"><span class="hs-pragma hs-type">modifyFdOnce</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span class="annot"><a href="GHC.Event.Internal.html#delete"><span class="hs-identifier hs-type">delete</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span id="delete"><span class="annot"><span class="annottext">delete :: Backend -&gt; IO ()
</span><a href="GHC.Event.Internal.html#delete"><span class="hs-identifier hs-var hs-var">delete</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Event.Internal.html#Backend"><span class="hs-identifier hs-type">Backend</span></a></span><span> </span><span id="local-6989586621679552361"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552361"><span class="hs-identifier hs-var">bState</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Timeout -&gt; (Fd -&gt; Event -&gt; IO ()) -&gt; IO Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; Event -&gt; IO Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Fd -&gt; Event -&gt; IO Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679552360"><span class="annot"><span class="annottext">a -&gt; IO ()
</span><a href="#local-6989586621679552360"><span class="hs-identifier hs-var">bDelete</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO ()
</span><a href="#local-6989586621679552360"><span class="hs-identifier hs-var">bDelete</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552361"><span class="hs-identifier hs-var">bState</span></a></span><span>
</span><span id="line-90"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#delete"><span class="hs-pragma hs-type">delete</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="hs-comment">-- | Throw an 'Prelude.IOError' corresponding to the current value of</span><span>
</span><span id="line-93"></span><span class="hs-comment">-- 'getErrno' if the result value of the 'IO' action is -1 and</span><span>
</span><span id="line-94"></span><span class="hs-comment">-- 'getErrno' is not 'eINTR'.  If the result value is -1 and</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- 'getErrno' returns 'eINTR' 0 is returned.  Otherwise the result</span><span>
</span><span id="line-96"></span><span class="hs-comment">-- value is returned.</span><span>
</span><span id="line-97"></span><span id="local-6989586621679552403"><span class="annot"><a href="GHC.Event.Internal.html#throwErrnoIfMinus1NoRetry"><span class="hs-identifier hs-type">throwErrnoIfMinus1NoRetry</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679552403"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679552403"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679552403"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679552403"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-98"></span><span id="throwErrnoIfMinus1NoRetry"><span class="annot"><span class="annottext">throwErrnoIfMinus1NoRetry :: forall a. (Eq a, Num a) =&gt; String -&gt; IO a -&gt; IO a
</span><a href="GHC.Event.Internal.html#throwErrnoIfMinus1NoRetry"><span class="hs-identifier hs-var hs-var">throwErrnoIfMinus1NoRetry</span></a></span></span><span> </span><span id="local-6989586621679552346"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679552346"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621679552345"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679552345"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-99"></span><span>    </span><span id="local-6989586621679552344"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552344"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679552345"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-100"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552344"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span>
</span><span id="line-101"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-102"></span><span>            </span><span id="local-6989586621679552343"><span class="annot"><span class="annottext">Errno
</span><a href="#local-6989586621679552343"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Errno
</span><a href="Foreign.C.Error.html#getErrno"><span class="hs-identifier hs-var">getErrno</span></a></span><span>
</span><span id="line-103"></span><span>            </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Errno
</span><a href="#local-6989586621679552343"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">Errno -&gt; Errno -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Errno
</span><a href="Foreign.C.Error.html#eINTR"><span class="hs-identifier hs-var">eINTR</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO a
forall a. String -&gt; IO a
</span><a href="Foreign.C.Error.html#throwErrno"><span class="hs-identifier hs-var">throwErrno</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679552346"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-104"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679552344"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Event.Internal.html#exchangePtr"><span class="hs-pragma hs-type">exchangePtr</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-107"></span><span class="hs-comment">-- | @exchangePtr pptr x@ swaps the pointer pointed to by @pptr@ with the value</span><span>
</span><span id="line-108"></span><span class="hs-comment">-- @x@, returning the old value.</span><span>
</span><span id="line-109"></span><span id="local-6989586621679552396"><span class="annot"><a href="GHC.Event.Internal.html#exchangePtr"><span class="hs-identifier hs-type">exchangePtr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679552396"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679552396"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679552396"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-110"></span><span id="exchangePtr"><span class="annot"><span class="annottext">exchangePtr :: forall a. Ptr (Ptr a) -&gt; Ptr a -&gt; IO (Ptr a)
</span><a href="GHC.Event.Internal.html#exchangePtr"><span class="hs-identifier hs-var hs-var">exchangePtr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621679552341"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679552341"><span class="hs-identifier hs-var">dst</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621679552340"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679552340"><span class="hs-identifier hs-var">val</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-111"></span><span>  </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, Ptr a #)) -&gt; IO (Ptr a)
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-var">IO</span></a></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, Ptr a #)) -&gt; IO (Ptr a))
-&gt; (State# RealWorld -&gt; (# State# RealWorld, Ptr a #))
-&gt; IO (Ptr a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679552339"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679552339"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-112"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Addr# -&gt; State# RealWorld -&gt; (# State# RealWorld, Addr# #)
forall d. Addr# -&gt; Addr# -&gt; State# d -&gt; (# State# d, Addr# #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#atomicExchangeAddrAddr%23"><span class="hs-identifier hs-var">atomicExchangeAddrAddr#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679552341"><span class="hs-identifier hs-var">dst</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679552340"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679552339"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-113"></span><span>        </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679552338"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679552338"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679552337"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679552337"><span class="hs-identifier hs-var">old_val</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679552338"><span class="hs-identifier hs-var">s2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Ptr a
forall a. Addr# -&gt; Ptr a
</span><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-var">Ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679552337"><span class="hs-identifier hs-var">old_val</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-114"></span></pre></body></html>